<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@include file="/WEB-INF/views/init.jsp"%>

<script type="text/javascript">
    $(document).ready(function(){
        var ajaxDataRenderer = function(url, plot, options) {
            var ret = null;
            $.ajax({
                url: url,
                async: false,
                dataType:"json",
                success: function(data) {
                    ret = data;
                }
            });
            return ret;

        };

        var jsonurl = "/calc.samcom.su/chart/json";

        var plot = $.jqplot('chart', jsonurl,{
            title: "AJAX JSON Data Renderer",
            dataRenderer: ajaxDataRenderer,
            dataRendererOptions: {
                unusedOptionalUrl: jsonurl
            },
            highlighter: {
                show: true,
                sizeAdjust: 7.5
            },
            cursor: {
                show: true,
                tooltipLocation:'sw'
            }
        });
    });
</script>

<div id="chart" style="height:400px;width:600px; "></div>